package com.netease.nim.uikit.common.media.picker.loader;

import android.app.Activity;
import android.content.Context;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import com.tianshuai.gallerypic.inter.ImageLoader;
import com.tianshuai.gallerypic.widget.GalleryImageView;

/**
 * Created by Jinni on 2017/7/24 0024.
 */

public class GlideImageLoader implements ImageLoader{
    @Override
    public void displayImage(Activity activity, Context context, String path, GalleryImageView galleryImageView, int width, int height) {
        RequestOptions requestOptions = new RequestOptions()
                .diskCacheStrategy(DiskCacheStrategy.ALL)
                .placeholder(com.yancy.gallerypick.R.mipmap.gallery_pick_photo)
                .centerCrop();
        Glide.with(context)
                .load(path)
                .apply(requestOptions)
                .into(galleryImageView);
    }

    @Override
    public void clearMemoryCache() {

    }
}
